//1. 布尔类型
// let b = true;
let b: boolean;
b = true;
b = false;
b = !100;
// b = 100;// 不能将类型“number”分配给类型“boolean”。
let b2: boolean = true;
b2 = false;
// b2 = 'string';
// b2 = {};

//2. 数字类型
let n: number;
n = 100;
// n = 'love';
// n = '200';
n = 0b1010;// 二进制 0b
n = 0o777; // 八进制 0o
n = 521;   // 十进制
n = 0x1221;// 十六进制 0x
n = 1 + 200;
n = 2 * 200;
let n2: number = 369;

//3. 字符串类型
let str: string = 'loveyou';
let str2: string = "imissyou";
let str3: string = `ilikeyou`;

//4. 字面量
// let host: 'localhost';
// host = 'localhost';
// // host = '912';
// let port: 8080 = 8080;
// let type: 1 | 2 | 3;
// type = 1;
// type = 2;
// type = 4;

//5. any  任意
// let a: any;
// a = 100;
// a = 'loveyou';
// a = {};

//6. void 空的
// function fn():void{

// }

//7. object 类型
// let o:object;
// o = {};
// o = () => {}
// o = [];

//8. 数组
// let arr: number[] = [20, 1, 18, 0x256];
// let arr2: Array<string>;
// arr2 = ['a','b', "xxx"];
// arr2[0] //TS 知道这是一个字符串类型的数据
// arr[0]

//9. 元组
let t: [string, number, boolean];
t = ['张三', 18, false];

let t2: [string, number, boolean] = ['李四',28,true];

let t3: [string, number, boolean][];
t3 = [['张三', 18, false], ['李四',28,true]];

//10. 枚举类型
enum Gender{
  Female='女',
  Male='男',
  Secret='保密'
}

enum Week{
  Monday = '礼拜一',
  Tuesday = '礼拜二',
  Wednesday = '礼拜三',
  Thursday = '礼拜四',
  Friday = '礼拜五',
  Saturday = '礼拜六',
  Sunday = '礼拜日',
}

//保存某个用户的性别
let gender = Gender.Female;
let week = Week.Wednesday;






